//Programa principal
#include "myFunctions.h"
#include "som.h"

int main(int argc,char *argv[]){
	vector< vector<double> > X;
	vector<int> y;
	bool ex = true;
	if(ex){
		cout<<"Levantamos 'clouds.csv'. "<<endl;
		readFile(X,y,"clouds.csv",false);
		/*
		for (unsigned int i=0;i<X.size();i++){
			for (unsigned int j=0;j<X[i].size();j++){
				cout<<X[i][j]<<"       ";
			}
			cout<<endl;
			cin.get();
		}
		*/
		SOM som(X);
		//Para la fase de ordenamiento
		som.ordering_phase(1);
		//Para la fase de transicion
		som.transition_phase(1);
		//Para la fase de convergencia
		som.convergence_phase(1);
		som.classification(y);
	}
	else{
		cout<<"Levantamos 'phoneme.csv'. "<<endl;
		readFile(X,y,"phoneme.csv",false);
		/*
		for (unsigned int i=0;i<X.size();i++){
			for (unsigned int j=0;j<X[i].size();j++){
				cout<<X[i][j]<<"       ";
			}
			cout<<endl;
			cin.get();
		}
		*/
		SOM som(X);
		//Para la fase de ordenamiento
		som.ordering_phase(1);
		//Para la fase de transicion
		som.transition_phase(1);
		//Para la fase de convergencia
		som.convergence_phase(1);
		som.classification(y);
	}
	return 0;
}
